Import diddy
Import model

Class ObjectSprite  Extends Sprite
	Public 
	Field type:String
	Field number:Int
	
	Method New(img:GameImage,x#, y#, _type:String, _frame:Int=0)
		Super.New(img,x,y)
		type=_type
		frame=_frame
	End
	
	Method Draw:Void(offsetx:Float = 0, offsety:Float = 0, rounded:Bool = false)
		Local width =(-_model.screenX)+SCREEN_WIDTH
		Local height =(-_model.screenY)+SCREEN_HEIGHT
		
		if  y - image.h >= height
			Return
		End
		If x  + image.w < -_model.screenX Or x - image.w >= width
			 return
		ElseIf y  + image.h < -_model.screenY
			 return			 
		Endif
		
		SetAlpha self.alpha
		SetColor red, green, blue ' doesnt work with images!?!??!

		DrawImage(image.image, x - offsetx, y - offsety, rotation, scaleX, scaleY, frame)
		SetColor 255, 255, 255
		SetAlpha 1

	'	if debug
	'		drawRectOutline(x + hitBoxX, y + hitBoxY, hitBoxWidth, hitBoxHeight)
	'	End
	End
End





